select GHRYEAR.*,formmain_0118.id from GHRYEAR,formmain_0118 where
trim(formmain_0118.field0003)=trim(GHRYEAR.EMPNO) and trim(GHRYEAR.YEAR)=formmain_0118.field0006
and (trim(GHRYEAR.YEAR)<>formmain_0118.field0006 or trim(GHRYEAR.TAKE_HRS)<>formmain_0118.field0007 or 
trim(GHRYEAR.BALANCE_HRS)<>formmain_0118.field0008)